package sctu.edu.java.year2016.team07.huangsuixin.day20160605.chapter11_2;

import java.util.Scanner;

/**
 * Created by Huang Suixin on 2016/6/5.
 */
public class Number {
    public static long count(int a,int b)throws Exception{
        if(a>10000||b>10000){
            throw new Exception("a或b太大了，超出了10000");
        }
        return a*b;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("输入a的值：");
        int a = scan.nextInt();
        System.out.print("输入b的值：");
        int b = scan.nextInt();
        try{
            long num = count(a,b);
            System.out.println("a*b="+num);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("a="+a+" "+"b="+b);
        }
    }
}
